{"ast":null,"code":"import _defineProperty from \"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/defineProperty.js\";\nimport _slicedToArray from \"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";\nvar __rest = this && this.__rest || function (s, e) {\n  var t = {};\n  for (var p in s) {\n    if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n  }\n  if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n    if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n  }\n  return t;\n};\nimport EyeInvisibleOutlined from \"@ant-design/icons/es/icons/EyeInvisibleOutlined\";\nimport EyeOutlined from \"@ant-design/icons/es/icons/EyeOutlined\";\nimport classNames from 'classnames';\nimport omit from \"rc-util/es/omit\";\nimport { composeRef } from \"rc-util/es/ref\";\nimport * as React from 'react';\nimport { useRef, useState } from 'react';\nimport { ConfigContext } from '../config-provider';\nimport useRemovePasswordTimeout from './hooks/useRemovePasswordTimeout';\nimport Input from './Input';\nvar defaultIconRender = function defaultIconRender(visible) {\n  return visible ? /*#__PURE__*/React.createElement(EyeOutlined, null) : /*#__PURE__*/React.createElement(EyeInvisibleOutlined, null);\n};\nvar ActionMap = {\n  click: 'onClick',\n  hover: 'onMouseOver'\n};\nvar Password = /*#__PURE__*/React.forwardRef(function (props, ref) {\n  var _props$visibilityTogg = props.visibilityToggle,\n    visibilityToggle = _props$visibilityTogg === void 0 ? true : _props$visibilityTogg;\n  var visibilityControlled = typeof visibilityToggle === 'object' && visibilityToggle.visible !== undefined;\n  var _useState = useState(function () {\n      return visibilityControlled ? visibilityToggle.visible : false;\n    }),\n    _useState2 = _slicedToArray(_useState, 2),\n    visible = _useState2[0],\n    setVisible = _useState2[1];\n  var inputRef = useRef(null);\n  React.useEffect(function () {\n    if (visibilityControlled) {\n      setVisible(visibilityToggle.visible);\n    }\n  }, [visibilityControlled, visibilityToggle]);\n  // Remove Password value\n  var removePasswordTimeout = useRemovePasswordTimeout(inputRef);\n  var onVisibleChange = function onVisibleChange() {\n    var disabled = props.disabled;\n    if (disabled) {\n      return;\n    }\n    if (visible) {\n      removePasswordTimeout();\n    }\n    setVisible(function (prevState) {\n      var _a;\n      var newState = !prevState;\n      if (typeof visibilityToggle === 'object') {\n        (_a = visibilityToggle.onVisibleChange) === null || _a === void 0 ? void 0 : _a.call(visibilityToggle, newState);\n      }\n      return newState;\n    });\n  };\n  var getIcon = function getIcon(prefixCls) {\n    var _iconProps;\n    var _props$action = props.action,\n      action = _props$action === void 0 ? 'click' : _props$action,\n      _props$iconRender = props.iconRender,\n      iconRender = _props$iconRender === void 0 ? defaultIconRender : _props$iconRender;\n    var iconTrigger = ActionMap[action] || '';\n    var icon = iconRender(visible);\n    var iconProps = (_iconProps = {}, _defineProperty(_iconProps, iconTrigger, onVisibleChange), _defineProperty(_iconProps, \"className\", \"\".concat(prefixCls, \"-icon\")), _defineProperty(_iconProps, \"key\", 'passwordIcon'), _defineProperty(_iconProps, \"onMouseDown\", function onMouseDown(e) {\n      // Prevent focused state lost\n      // https://github.com/ant-design/ant-design/issues/15173\n      e.preventDefault();\n    }), _defineProperty(_iconProps, \"onMouseUp\", function onMouseUp(e) {\n      // Prevent caret position change\n      // https://github.com/ant-design/ant-design/issues/23524\n      e.preventDefault();\n    }), _iconProps);\n    return /*#__PURE__*/React.cloneElement( /*#__PURE__*/React.isValidElement(icon) ? icon : /*#__PURE__*/React.createElement(\"span\", null, icon), iconProps);\n  };\n  var className = props.className,\n    customizePrefixCls = props.prefixCls,\n    customizeInputPrefixCls = props.inputPrefixCls,\n    size = props.size,\n    restProps = __rest(props, [\"className\", \"prefixCls\", \"inputPrefixCls\", \"size\"]);\n  var _React$useContext = React.useContext(ConfigContext),\n    getPrefixCls = _React$useContext.getPrefixCls;\n  var inputPrefixCls = getPrefixCls('input', customizeInputPrefixCls);\n  var prefixCls = getPrefixCls('input-password', customizePrefixCls);\n  var suffixIcon = visibilityToggle && getIcon(prefixCls);\n  var inputClassName = classNames(prefixCls, className, _defineProperty({}, \"\".concat(prefixCls, \"-\").concat(size), !!size));\n  var omittedProps = Object.assign(Object.assign({}, omit(restProps, ['suffix', 'iconRender', 'visibilityToggle'])), {\n    type: visible ? 'text' : 'password',\n    className: inputClassName,\n    prefixCls: inputPrefixCls,\n    suffix: suffixIcon\n  });\n  if (size) {\n    omittedProps.size = size;\n  }\n  return /*#__PURE__*/React.createElement(Input, Object.assign({\n    ref: composeRef(ref, inputRef)\n  }, omittedProps));\n});\nif (process.env.NODE_ENV !== 'production') {\n  Password.displayName = 'Password';\n}\nexport default Password;","map":{"version":3,"names":["__rest","s","e","t","p","Object","prototype","hasOwnProperty","call","indexOf","getOwnPropertySymbols","i","length","propertyIsEnumerable","EyeInvisibleOutlined","EyeOutlined","classNames","omit","composeRef","React","useRef","useState","ConfigContext","useRemovePasswordTimeout","Input","defaultIconRender","visible","createElement","ActionMap","click","hover","Password","forwardRef","props","ref","visibilityToggle","visibilityControlled","undefined","setVisible","inputRef","useEffect","removePasswordTimeout","onVisibleChange","disabled","prevState","_a","newState","getIcon","prefixCls","action","iconRender","iconTrigger","icon","iconProps","preventDefault","cloneElement","isValidElement","className","customizePrefixCls","customizeInputPrefixCls","inputPrefixCls","size","restProps","useContext","getPrefixCls","suffixIcon","inputClassName","omittedProps","assign","type","suffix","process","env","NODE_ENV","displayName"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/antd/es/input/Password.js"],"sourcesContent":["var __rest = this && this.__rest || function (s, e) {\n  var t = {};\n  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n  if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n    if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n  }\n  return t;\n};\nimport EyeInvisibleOutlined from \"@ant-design/icons/es/icons/EyeInvisibleOutlined\";\nimport EyeOutlined from \"@ant-design/icons/es/icons/EyeOutlined\";\nimport classNames from 'classnames';\nimport omit from \"rc-util/es/omit\";\nimport { composeRef } from \"rc-util/es/ref\";\nimport * as React from 'react';\nimport { useRef, useState } from 'react';\nimport { ConfigContext } from '../config-provider';\nimport useRemovePasswordTimeout from './hooks/useRemovePasswordTimeout';\nimport Input from './Input';\nconst defaultIconRender = visible => visible ? /*#__PURE__*/React.createElement(EyeOutlined, null) : /*#__PURE__*/React.createElement(EyeInvisibleOutlined, null);\nconst ActionMap = {\n  click: 'onClick',\n  hover: 'onMouseOver'\n};\nconst Password = /*#__PURE__*/React.forwardRef((props, ref) => {\n  const {\n    visibilityToggle = true\n  } = props;\n  const visibilityControlled = typeof visibilityToggle === 'object' && visibilityToggle.visible !== undefined;\n  const [visible, setVisible] = useState(() => visibilityControlled ? visibilityToggle.visible : false);\n  const inputRef = useRef(null);\n  React.useEffect(() => {\n    if (visibilityControlled) {\n      setVisible(visibilityToggle.visible);\n    }\n  }, [visibilityControlled, visibilityToggle]);\n  // Remove Password value\n  const removePasswordTimeout = useRemovePasswordTimeout(inputRef);\n  const onVisibleChange = () => {\n    const {\n      disabled\n    } = props;\n    if (disabled) {\n      return;\n    }\n    if (visible) {\n      removePasswordTimeout();\n    }\n    setVisible(prevState => {\n      var _a;\n      const newState = !prevState;\n      if (typeof visibilityToggle === 'object') {\n        (_a = visibilityToggle.onVisibleChange) === null || _a === void 0 ? void 0 : _a.call(visibilityToggle, newState);\n      }\n      return newState;\n    });\n  };\n  const getIcon = prefixCls => {\n    const {\n      action = 'click',\n      iconRender = defaultIconRender\n    } = props;\n    const iconTrigger = ActionMap[action] || '';\n    const icon = iconRender(visible);\n    const iconProps = {\n      [iconTrigger]: onVisibleChange,\n      className: `${prefixCls}-icon`,\n      key: 'passwordIcon',\n      onMouseDown: e => {\n        // Prevent focused state lost\n        // https://github.com/ant-design/ant-design/issues/15173\n        e.preventDefault();\n      },\n      onMouseUp: e => {\n        // Prevent caret position change\n        // https://github.com/ant-design/ant-design/issues/23524\n        e.preventDefault();\n      }\n    };\n    return /*#__PURE__*/React.cloneElement( /*#__PURE__*/React.isValidElement(icon) ? icon : /*#__PURE__*/React.createElement(\"span\", null, icon), iconProps);\n  };\n  const {\n      className,\n      prefixCls: customizePrefixCls,\n      inputPrefixCls: customizeInputPrefixCls,\n      size\n    } = props,\n    restProps = __rest(props, [\"className\", \"prefixCls\", \"inputPrefixCls\", \"size\"]);\n  const {\n    getPrefixCls\n  } = React.useContext(ConfigContext);\n  const inputPrefixCls = getPrefixCls('input', customizeInputPrefixCls);\n  const prefixCls = getPrefixCls('input-password', customizePrefixCls);\n  const suffixIcon = visibilityToggle && getIcon(prefixCls);\n  const inputClassName = classNames(prefixCls, className, {\n    [`${prefixCls}-${size}`]: !!size\n  });\n  const omittedProps = Object.assign(Object.assign({}, omit(restProps, ['suffix', 'iconRender', 'visibilityToggle'])), {\n    type: visible ? 'text' : 'password',\n    className: inputClassName,\n    prefixCls: inputPrefixCls,\n    suffix: suffixIcon\n  });\n  if (size) {\n    omittedProps.size = size;\n  }\n  return /*#__PURE__*/React.createElement(Input, Object.assign({\n    ref: composeRef(ref, inputRef)\n  }, omittedProps));\n});\nif (process.env.NODE_ENV !== 'production') {\n  Password.displayName = 'Password';\n}\nexport default Password;"],"mappings":";;AAAA,IAAIA,MAAM,GAAG,IAAI,IAAI,IAAI,CAACA,MAAM,IAAI,UAAUC,CAAC,EAAEC,CAAC,EAAE;EAClD,IAAIC,CAAC,GAAG,CAAC,CAAC;EACV,KAAK,IAAIC,CAAC,IAAIH,CAAC;IAAE,IAAII,MAAM,CAACC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACP,CAAC,EAAEG,CAAC,CAAC,IAAIF,CAAC,CAACO,OAAO,CA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